package org.misty.blog.service;

import org.misty.blog.po.Category;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Optional;

public interface CategoryService {
    Category saveCategory(Category category);

    Optional<Category> getCategory(Long id);

    Optional<Category> getCategoryByName(String name);

    Page<Category> listCategory(Pageable pageable);

    List<Category> listCategory();

    List<Category> listTop(int n);

    Category updateCategory(Long id, Category category);

    void removeCategory(Long id);
}
